package com.thread;

import java.util.concurrent.locks.ReentrantLock;

public class RetranLockTest {
   volatile private static boolean run = true;

    public static void main(String[] args) throws InterruptedException {
        new Thread(()->{
            while(run){

            }
        }).start();
        Thread.sleep(2);
        System.out.println("停止");
        run=false;
    }
}